using UnityEngine;

public class LiquidFrameController : MonoBehaviour
{
	private SpriteRenderer spriteRenderer;

	private void Awake()
	{
		spriteRenderer = GetComponent<SpriteRenderer>();
	}

	public void SetLiquidFrameHeight(Vector3 glassUpperEdge)
	{
		Vector3 max = spriteRenderer.bounds.max;
		float y = max.y;
		float num = y - glassUpperEdge.y + 0.1f;
		Vector2 size = spriteRenderer.size;
		size.y -= num * 0.9090909f;
		spriteRenderer.size = size;
		Vector3 position = base.transform.position;
		position.y -= num * 0.5f;
		base.transform.position = position;
	}
}
